<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin:0;padding:0;}
        .div{
            width: 300px;
            height: 300px;
            position: relative;
            border:1px solid blue;
            margin:100px;
        }
        .div1{
            width: 100px;
            height: 100px;   
            background-color: red;
            position: absolute;
            left:50px;
            top:50px;
        }
    </style>
</head>
<body>
        <div class="div">
            <div class="div1"></div>
        </div>
        <script>
            var oDiv = document.querySelector(".div1");
            var obj = oDiv.getBoundingClientRect(); 
            console.log( obj )
        </script>
</body>
</html>